﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>采购详单查看</title>
    <script src="/Apm/js/CMSView.js"></script>
    <style>
        .page{
            margin:1rem;
            border:1px solid #eee;
        }
        .view-title{
            display:flex;
            padding:0.6rem;

        }
        .view-title-label {
            display: flex;
            justify-content:center;
            width:calc(100% - 12rem);
        }
        .view-title-time {
            display: flex;
            width:10rem;
            justify-content: flex-end;
        }
        
    </style>
</head>
<body>
    <div class="page">
        <div class="view-title">
            <div class="view-title-label">
                <span>情义花卉基地鲜花采购明细</span>
            </div>
            <div class="view-title-time">
                <span id="ViewTitle"></span>
            </div>
        </div>

        <table id="tableView" lay-filter="dataView"></table>
    </div>
</body>
</html>
<script>
    layui.use('table', function () {
        var table = layui.table;

        var guid = getUrlParam('guid');
        ajaxget({
            url: 'api/FriendFlowerPublic/GetPurchase?Guid=' + guid,
            success: function (data) {

                $("#ViewTitle").html(data.Title);

                table.render({
                    id: 'dataView',
                    elem: '#tableView',
                    cols: [
                        [ //标题栏
                            { field: 'FlowerTypeName', title: '品名', align: 'center', width: 120, rowspan: 2, fixed:'left' },
                            { align: 'center', title: '采购数量', colspan: 4 },
                            { align: 'center', title: '实际数量', colspan: 4 },
                            { field: 'BreakdownNum', title: '损耗扎数', align: 'right', width: 120, rowspan: 2 },
                            { field: 'BreakdownProportion', title: '损耗比例', align: 'right', width: 120, rowspan: 2 },
                            { align: 'center', title: '采购价格', colspan: 4 },
                            { align: 'center', title: '预售价格', colspan: 4 },
                            { field: 'Remark', title: '备注', align: 'left', width:320, rowspan: 2 }
                        ],
                        [
                            { field: 'PurchaseNumA', title: 'A', align: 'right', width: 80 },
                            { field: 'PurchaseNumB', title: 'B', align: 'right', width: 80 },
                            { field: 'PurchaseNumC', title: 'C', align: 'right', width: 80 },
                            { field: 'PurchaseNumD', title: 'D', align: 'right', width: 80 },

                            { field: 'ActualNumA', title: 'A', align: 'right', width: 80 },
                            { field: 'ActualNumB', title: 'B', align: 'right', width: 80 },
                            { field: 'ActualNumC', title: 'C', align: 'right', width: 80 },
                            { field: 'ActualNumD', title: 'D', align: 'right', width: 80 },

                            { field: 'PurchasePriceA', title: 'A', align: 'right', width: 80 },
                            { field: 'PurchasePriceB', title: 'B', align: 'right', width: 80 },
                            { field: 'PurchasePriceC', title: 'C', align: 'right', width: 80 },
                            { field: 'PurchasePriceD', title: 'D', align: 'right', width: 80 },

                            { field: 'PlanPriceA', title: 'A', align: 'right', width: 80 },
                            { field: 'PlanPriceB', title: 'B', align: 'right', width: 80 },
                            { field: 'PlanPriceC', title: 'C', align: 'right', width: 80 },
                            { field: 'PlanPriceD', title: 'D', align: 'right', width: 80 }
                        ]
                    ],
                    data: data.PurchaseList,
                    height: 'full-68',
                    limit: 20,
                    limits: [20, 40, 60],
                    page: true
                })
            }
        })



    })
    
</script>